import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '@/views/login'
import Register from '@/views/register'
import Detail from '@/views/detail'
import Layout from '@/views/layout'
import Collect from '@/views/collect'
import Manage from '@/views/manage'
import cityList from '@/views/cityList'
import Release from '@/views/release'

import Index from '@/views/index'
import Find from '@/views/find'
import News from '@/views/news'
import My from '@/views/my'

Vue.use(VueRouter)

const router = new VueRouter({
  routes:[
    { path: '/login', component: Login },
    { path: '/register', component: Register },
    { path: '/detail', component: Detail },
    { path: '/collect', component: Collect },
    { path: '/manage', component: Manage },
    { path: '/cityList', component: cityList },
    { path: '/release', component: Release },
    {
      path: '/',
      component: Layout,
      children: [
        { path: '/index', component: Index },
        { path: '/find', component: Find },
        { path: '/news', component: News },
        { path: '/my', component: My }
      ]
    }
  ]
})

export default router
